|
The Trabb Pardo–Knuth algorithm is a program introduced by Donald Knuth and Luis Trabb Pardo to illustrate the evolution of computer programming languages. In their 1977 work "The Early Development of Programming Languages", Trabb Pardo and Knuth introduced a trivial program that involved arrays, indexing, mathematical functions, subroutines, I/O, conditionals and iteration. They then wrote implementations of the algorithm in several early programming languages to show how such concepts were expressed. The simpler Hello world program has been used for much the same purpose. ==The algorithm== ask for 11 numbers to be read into a sequence ''S'' reverse sequence ''S'' for each ''item'' in sequence ''S'' call a function to do an operation if ''result'' overflows alert user else print ''result'' The algorithm reads eleven numbers from an input device, stores them in an array, and then processes them in reverse order, applying a user-defined function to each value and reporting either the value of the function or a message to the effect that the value has exceeded some threshold. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Trabb Pardo–Knuth algorithm」の詳細全文を読む スポンサード リンク
|